import request from '@/utils/request'
export default{
    // 1、添加课程信息
    addCourseInfo(courseInfo){
        return request({
            url:'eduservice/course/addCourseInfo',
            method:'post',
            data: courseInfo
        })
    },
    getListTeacher(){       //下拉列表，查询所有讲师
        return request({
            url : 'eduservice/teacher/findAll',
            method: 'get'
        })
    },
     //根据课程id查询课程基本信息
     getCourseInfoId(id) {
        return request({
            url: '/eduservice/course/getCourseInfo/'+id,
            method: 'get'
          })
    },
    
    //修改课程信息
    updateCourseInfo(courseInfo) {
        return request({
            url: '/eduservice/course/updateCourseInfo',
            method: 'post',
            data: courseInfo
          })
    },
    //课程最终确认信息显示
    getPublishCourseInfo(id){
        return request({
            url:'/eduservice/course/getPublishCourseInfo/'+id,
            method:'get'
        })
    },
    //课程发布——修改课程的状态
    publishCourse(id){
        return request({
            url:'/eduservice/course/publishCourse/'+id,
            method:'post'
        })
    },

    //课程列表      TODO


    //课程列表--查询所有课程---分页
    getListCoursePage(current,limit,courseQuery){
        return request({
            url:`/eduservice/course/pageCourse/${current}/${limit}`,
            method:'get'
        })
    },

    //课程列表--查询所有课程
    getListCourse(){
        return request({
            url:'/eduservice/course/getListCourse',
            method:'get'
        })
    },
    getCourseListPage(current,limit,courseQuery){
        return request({
            url:`eduservice/course/pageCourseCondition/${current}/${limit}`,
            method:'post',
            data:courseQuery
        })
    },
    deleteCourseById(id){
        return request({
            url:`/eduservice/course/${id}`,
            method:'delete'
        })
    }
}